/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.nesimuge.score.gui.model;

import it.lapomuge.db.entity.Atleta;

import javax.swing.AbstractListModel;

/**
 *
 * @author Muge
 */
public class ModelListAtleti extends AbstractListModel {

    private Atleta[] atleti = new Atleta[0];

    public ModelListAtleti() {
    }

    public Atleta[] getAtleti() {
        return atleti;
    }

    public void setAtleti(Atleta[] atleti) {
        this.atleti = atleti;
        this.fireContentsChanged(this, 0, this.atleti.length);
    }

    public int getSize() {
        return atleti.length;
    }

    public Object getElementAt(int index) {
        return this.atleti[index].getCognome() + " " + this.atleti[index].getNome();
    }
}
